package net.hn.hnms.biz.plan.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.plan.request.StatisitcalAnalysisReq;
import net.hn.hnms.biz.plan.service.StatistcalAnalysisService;
import net.hn.hnms.biz.plan.vo.StatisticalDayOutputVo;
import net.hn.hnms.biz.plan.vo.StatisticalYearVo;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(value = "统计分析模块", tags = {"统计分析模块"})
@RestController
@RequestMapping("/statistical/output")
public class StatisticalAnalysisController {
    @Resource
    private StatistcalAnalysisService statistcalAnalysisService;

    @ApiOperation("产量统计分析")
    @GetMapping("/dayoutput")
    @AutoSetMineCode
    public R<List<StatisticalDayOutputVo>> dayoutput(StatisitcalAnalysisReq StatisitcalAnalysisReq) {
        return R.ok(statistcalAnalysisService.list(StatisitcalAnalysisReq));
    }

    @ApiOperation("年产量统计分析")
    @GetMapping("/yearoutput")
    @AutoSetMineCode
    public R<StatisticalYearVo> yearoutput(StatisitcalAnalysisReq StatisitcalAnalysisReq) {
        return R.ok(statistcalAnalysisService.listYearOutPut(StatisitcalAnalysisReq));
    }


    @ApiOperation("年进尺统计分析")
    @GetMapping("/yearfootage")
    @AutoSetMineCode
    public R<StatisticalYearVo> yearFootage(StatisitcalAnalysisReq StatisitcalAnalysisReq) {
        return R.ok(statistcalAnalysisService.listYearFootage(StatisitcalAnalysisReq));
    }
}
